<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" Content="text/html; charset=utf-8"/>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.js"></script>
	<link rel="stylesheet" type="text/css" href="../css/header.css">
	<link rel="stylesheet" type="text/css" href="../css/footer.css">
	<link rel="stylesheet" type="text/css" href="../css/contest.css">
	<link rel="stylesheet" type="text/css" href="../css/apply.css">
	<link rel="stylesheet" href="../res/bootstrap/css/bootstrap.min.css">
	<script src="../res/jquery-ui/jquery.ui.core.js"></script>
<script src="../res/jquery-ui/jquery.ui.widget.js"></script>
<script src="../res/jquery-ui/jquery.ui.datepicker.js"></script>
  
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
	<link rel="stylesheet" href="../res/jquery-ui/jquery.ui.all.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
	<script src="../res/jquery-ui/jquery-1.10.2.js"></script>
	
	<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.js"></script>
	<script src="//netdna.bootstrapcdn.com/bootstrap/2.3.2/js/bootstrap.min.js"></script>
		<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
		<script type="text/javascript" src="../se2/js/HuskyEZCreator.js"></script>
<script src="../myUtil.js"></script>
	<script type="text/javascript" src="../js/createContest.js"></script>
<script> 
  
</script> 

<body ng-app="myModule">

<div class="container" ng-controller="MyController">


<!-- header-->
<div class="header span12"></div>

<h1>대회 생성</h1>
<br/>
<form action="createContest.do" method="post" enctype="multipart/form-data" style="margin: 10px 0 0 0;" onsubmit="return createContest()">
	<div class="span2">대회명:</div>
	<input name="contest_id" type="hidden" value="{{contest_id}}"/>
	<select  ng-model="contest_id" ng-options="item.contest_id as item.name for item in contestItems">
		<option value="">(+)신규대회등록</option>
	</select>
	
	<input type="text" name="name" ng-model="$parent.name" placeholder="새로운 대회명을 입력하세요." ng-if="contest_id==null"  ng-change="nameCheck()" />
	
	<div ng-if="checkName!=null && checkName=='true'"  class="alert">사용가능한 대회 이름입니다.</div>
	
	<div ng-if="checkName!=null && checkName=='false'" class="alert alert-error">중복되는 대회 이름입니다. 다른이름을 입력해주세요.</div>
	
	<span></span>
	<br/><br/>
	
	<div class="span2" >회차:</div>
	<input ng-model="count" maxlength="5" name="count" id="count" type="text" class="count" onkeydown="numObj(event)" />
	<div ng-if="checkCount!=null && checkCount=='true'"  class="alert">사용가능한 회차입니다.</div>
	
	<div ng-if="checkCount!=null && checkCount=='false'" class="alert alert-error">중복되는 회차입니다. 다른 회차로 입력해주세요.</div>
	<br/>
	
	<div class="span2">참여 가능 여부:</div>
	대회별 참여<input type="radio" name="track_check" value="0" checked/>
	주제별 참여<input type="radio" name="track_check" value="1"/>
	
	
	<span class="span12" style="color:gray;"><i class="icon-info-sign"></i><strong>(주의)</strong>이미 대회에 참가한 학생이 있는 경우에는 참여 가능 여부를 더 이상 수정 하실 수 없습니다.</span><br/><br/>
	<br/>
	
	<div class="span2">주제:</div><a class="btn btn-info" ng-click="addTrack(); check=false; total()">주제 추가</a>
	<br/>
	<div class="offset1" ng-repeat="item in trackItems">
	<input type="text" class="track span2" id="tra" name="tracks" ng-model="item.track" ng-change="$parent.total()"/>
	<a class="btn" ng-if="$index!=0" ng-click="removeTrack($index); check=true">삭제</a>
	</div>
	
	
	<div class="span12" style="color:gray;"><i class="icon-info-sign"></i>주제는 반드시 하나 이상 등록해야 합니다.</div><br/><br/><br/>
	
	
	<br/>
	<br/>
	<div class="span2">접수 신청일:</div>
	<input type="text" name="contest_reg_date" class="date_a_s datepicker" ng-model="date_a_s"  ng-change="total()" readonly/><br/>
	
	<div class="span2">접수 마감일:</div>
	<input type="text" name="contest_reg_date" class="date_a_e datepicker" ng-model="date_a_e" ng-change="total()" readonly/><br/>
	
	<div class="span2">자료제출 시작일:</div>
	<input type="text" name="contest_reg_date" class="date_r_s datepicker" ng-model="date_r_s" ng-change="total()" readonly/><br/>
	
	<div class="span2">자료제출 마감일:</div>
	<input type="text" name="contest_reg_date" class="date_r_e datepicker" ng-model="date_r_e" ng-change="total()" readonly/><br/>
	
	<div class="span2">대회 마감일:</div>
	<input type="text" name="contest_reg_date" class="date_end datepicker" ng-model="date_end" ng-change="total()" readonly/><br/>
	
	<div class="span2">그 외 날짜:</div><a class="btn btn-info" ng-click="addDate()">날짜 추가</a><br/>
	
	<div ng-repeat="item in date">
	<input type="hidden" name="schedule_name" value="{{item.name}}"/>
	<input type="hidden" name="schedule" value="{{item.date}}"/>
	<input type="text" ng-model="item.name" placeholder="날짜의 이름을 입력하세요."/>
	<input type="text" ng-model="item.date" ng-click="clickDate($index)" datepicker datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" readonly/>
	<a class="btn" ng-click="removeDate($index)">제거</a><br/>
	</div>
	
		<i class="icon-info-sign"></i><span style="color:gray;">`1차 기획안 제출일` 등 다른 날짜를 추가할 수 잇습니다.</span>
	<br/><br/>
	
	
	<div class="span2">첨부 파일:
		</div>
		<input type="file" name="file"/><br/>
		
	<div class="span2">내용
	
	
	</div>
	<textarea class="offset1" id="text" rows="5" name="content" cols="8"
		style="margin:10px 20px 20px 20px; width:500px" placeholder="경진대회 내용"></textarea>
	
	<br/>

	<br/>
	
	
		
	<input class="btn btn-primary save offset5" name="save" type="submit" value="저장하기" disabled/>
</form>


	

<!--footer-->
	
	<div class="footer span12"></div>
<!--//footer-->
</div>


</body>

</head>
</html>